/*
 * @Author: 姚潘涛
 * @Date: 2024-06-03 10:40:39
 * @LastEditors: 姚潘涛
 * @LastEditTime: 2024-10-10 19:23:07
 * @Description:
 *
 * Copyright (c) 2024 by pandaman, All Rights Reserved.
 */
#pragma once

#include "xict_common/log/log.h"
#include "xict_common/perception/detection/yolo.h"
#include <iostream>
#include <math.h>
#include <opencv2/opencv.hpp>

namespace xict_common {
    namespace perception {
        namespace detection {
            /**
             * @brief yolo识别结果
             *
             */
            struct struct_yolo_result {
                cv::Mat img;
                std::vector<Output> result;
            };

            class YoloDetect {
            public:
                YoloDetect(std::string model_path, bool use_CUDA);
                ~YoloDetect();
                cv::Mat Detect(cv::Mat img);
                struct struct_yolo_result DetectBbox(cv::Mat img);

            private:
                Yolo yolo;
                cv::dnn::Net net;
                std::vector<cv::Scalar> color;
                std::vector<Output> result;
                bool use_CUDA = true;
            };
        }   // namespace detection
    }       // namespace perception
}   // namespace xict_common
